<?php $this->context->layout = 'form';?>
<?= \common\widgets\Asset::widget(['type'=>['dragula']])?>

<form class="form-horizontal m" id="form-edit">
    <?= \common\widgets\FormInput::widget(['name'=>'input','extend'=>['name'=>'id','type'=>'hidden','info'=>$info]])?>
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>商品信息</th>
            <th>支付金额</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($ordergoods as $k=>$orde):?>
            <tr>
                <td><div><img src="<?=$orde['main_img']?>" style="width: 100px" alt=""></div><div><?=$orde['good_name']?></div></td>
                <td>
                    <input type="number" class="form-control" name="spec[<?=$k?>][total_pay_price]" value="<?=$orde['total_pay_price']?>">
                    <input type="hidden" name="spec[<?=$k?>][id]" value="<?=$orde['id']?>">
                </td>
            </tr>
        <?php endforeach;?>
        </tbody>
    </table>
</form>
<?php $this->beginBlock('script'); ?>
<script>
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("<?=\yii\helpers\Url::to(['edit-amount'])?>", $('#form-edit').serialize());
        }
    }
</script>
<?php $this->endBlock(); ?>
